package com.jinhongone.pattern.creater.prototype.test;

/*
 * 创建一个具体原型类
 * */
public class Citation implements Cloneable {

    /*private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }*/

    //替换为引用数据类型，暴露浅克隆存在的问题
    private Student stu;

    public Student getStu() {
        return stu;
    }

    public void setStu(Student stu) {
        this.stu = stu;
    }

    @Override
    protected Citation clone() throws CloneNotSupportedException {
        return (Citation) super.clone();
    }

    public void show() {
        System.out.println(stu.getName() + "同学在本学习表现良好，特办法此证明");
    }
}
